package com.topisv.tms.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.ShippedBox;

public interface ShippedBoxDao extends JpaSpecificationExecutor<ShippedBox>,
		PagingAndSortingRepository<ShippedBox, Long> {
	
	@Modifying
	@Query("delete from ShippedBox sb where sb.batchCode=?1")
	void delete(String batchCode);
	
	@Modifying
	@Query("delete from ShippedBox sb where sb.boxCode=?1")
	void deleteBoxCode(String boxCode);

	ShippedBox findByBoxCode(String boxCode);
	
	List<ShippedBox> findByBatchCode(String batchCode);
}
